<div class="container">
  <div class="row">
    <div class="col-md-4 ">
    <h3>中医体质分类与判定表</h3>
    </div>
  </div>
</div>
<% @data.each do |data| %>
  <table class="table table-bordered">
    <thead>
      <caption><%= data['caption'] %></caption>
    </thead>
    <tbody>
      <tr>
        <th>根据近一年的体验和感觉回答下问题</th>
        <th>没有或根本不</th>
        <th>很少或有一点</th>
        <th>有时或有些</th>
        <th>经常或相当</th>
        <th>总是或非常</th>
      </tr>
      <% data["children"].each_with_index do |child, index| %>
        <tr>
          <td><%= child['question'] %></td>
          <% child['answer_score'].each do |answer_score| %>
            <td><input type="radio" name="radio<%= data['id'].to_s + index.to_s %>" value="<%= answer_score %>" class="group<%= data["id"] %>"></td>
          <% end %>
        </tr>
      <% end %>
      <%= render 'result', group: data['id'] %>
    </tbody>
  </table>
<% end %>
